package com.mintyfresh.tns.client;

import java.awt.event.*;

public class KeyboardListener implements KeyListener {
	public void keyTyped(KeyEvent e) {}

	public void keyPressed(KeyEvent e) {
		GameWindow gameWindow = (GameWindow)e.getComponent();
		String key = e.getKeyText(e.getKeyCode());
		if(key.equals("Up")) {
			gameWindow.incPower();
		}
		if(key.equals("Down")) {
			gameWindow.decPower();
		}
		if(key.equals("Right")) {
			gameWindow.incAngle();
		}
		if(key.equals("Left")) {
			gameWindow.decAngle();
		}
		if(key.equals("Enter")) {
			gameWindow.shoot();
		}
	}

	public void keyReleased(KeyEvent e) {}
}
